package org.elanfox.intellicommunity.biz.repository.msg;

import org.elanfox.intellicommunity.biz.entity.msg.AlarmMsgPO;
import org.elanfox.intellicommunity.data.base.base.JpaSearchableRepository;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Repository;

/**
 * @author allan
 * @version 1.0.0
 * @date 2019/12/19
 */
@Repository
public interface AlarmMsgRepository extends JpaSearchableRepository<AlarmMsgPO, Long> {
    AlarmMsgPO findTopByUserIdOrderByCreateTimeDesc(Integer userId);

    Page<AlarmMsgPO> findByAlarmMsgGroupPO_GroupId(Long groupId, Pageable pageable);

    AlarmMsgPO findTopByAlarmMsgGroupPO_GroupIdOrderByCreateTimeDesc(Long groupId);
}
